# -*- coding: utf-8 -*-
# 操作内容：
# @Software: PyCharm
# @File: login_api.py
# @Author: 一碗好酒（张智）
# @E-mail: 1473658931@qq.com,
# @Time: 7月 08, 2021
# ---
from api.base_api import BuyerBaseApi, BasicBaseApi
from common.client import RequestsClient
from common.encry_decry import md5
from setting import DIR_NAME


class UploadFileApi(BasicBaseApi):
    def __init__(self, filename):
        # 继承父类，并改写
        super().__init__()
        self.url = self.host + '/uploaders'
        self.method = 'post'
        self.params = {
            'scene': 'goods'
        }
        self.files = {
            'file': ('切片.png', open(DIR_NAME + '/data/' + filename, 'rb'), 'image/png')
        }


if __name__ == '__main__':
    UploadFileApi('切片.png').send()
